package java0226;
import java.util.Scanner;
import java.lang.Integer;

public class java505 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (sc.hasNextInt()) {
			int num=sc.nextInt();
			if(num<=2147483647&&num>=-2147483648){
				String s1= null;
				s1=Integer.toBinaryString(num);
				int result = 0;
				char ch[]=s1.toCharArray();
				for (int i = 0; i < s1.length(); ++i) {
					if (ch[i]>='0'||ch[i]<='9') result++;					
				}
				if(num == 0 )System.out.println(32-num);
				else System.out.println(32-result);
			}
		}
	sc.close();
	}

}
